﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using YasharEl.Infrastructure.EntityModel;
using YasharEl.Infrastructure.EntityModel.Specifications.QueryableSpecification;

namespace YasharEl.Infrastructure.ProcessEngine.PersistenceModel.Specifications
{
    public class ProcessQueryableSpecification : QueryableSpecification<IProcess, long>, IProcessSpecification
    {
        #region Constructors

        public ProcessQueryableSpecification(IUnitOfWorkConvertor unitOfWorkConvertor)
            :base(unitOfWorkConvertor)
        {

        }

        #endregion

        #region IProcessSpecification Members

        public IProcessSpecification WithWorkflowInstanceId(Guid workflowInstanceId)
        {
            Queryable = Queryable.Where(
                c => c.WorkflowInstanceId == workflowInstanceId
            );

            return this;
        }

        #endregion
    }
}
